-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vivado: init at 2017.2 #93436
base: master
Are you sure you want to change the base?
vivado: init at 2017.2 #93436
Conversation
# requireFile prevents rehashing each time, which saves time during | ||
# rebuilds. | ||
src = requireFile rec { | ||
name = "Xilinx_Vivado_SDK_2017.2_0616_1.tar.gz"; | ||
message = '' | ||
This nix expression requires that ${name} is already part of the store. | ||
Login to Xilinx, download from | ||
https://www.xilinx.com/support/download.html, | ||
rename the file to ${name}, and add it to the nix store with | ||
"nix-prefetch-url file:///path/to/${name}". | ||
''; | ||
sha256 = "06pb4wjz76wlwhhzky9vkyi4aq6775k63c2kw3j9prqdipxqzf9j"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the requireFile
arguments (name
and sha256
) arguments with default values to the derivation (i.e. after line 21)? That'll make it a bit easier for people to upgrade on their own (with vivado.override { name = "..."; sha256 = "..."; }
rather than making an overlay) after Xilinx releases new versions that haven't been hashed/submitted here yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@9999years definitely. The only thing is I can't guarantee the builder will work for anything other than this version. For instance, the builder failed for 2019.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with
vivado.override { name = "..."; sha256 = "..."; }
rather than making an overlay
For instance, the builder failed for 2019.
Than we should not add this and let people overwrite it with overwriteAttr
I marked this as stale due to inactivity. → More info |
@flokli you told me you had some Vivado exprs, do you know which version it is for? |
@RaitoBezarius thanks for the reminder - I'd let this PR slip. I think the only remaining thing to do is to migrate the stuff from |
I made a simple attempt to migrate builder.sh into default.nix. Builds fine, although I haven't tested the vivado binary since I'm running into this at the moment. |
Something we might want to consider is the installed modules are currently not configurable. It might be better to allow these to be easily overridden. I don't know what happens with the installation when modules that are not supported by the free edition are selected. But, for instance, some Kintex-7 devices are available in the free edition and these are not currently installed. |
Do you know which glibc is needed and can you attempt a explicit LD_PRELOAD? |
I think we can revisit this later, ultimately, but it's good to keep it in mind. |
dontBuild = true; | ||
|
||
installPhase = '' | ||
# generate an installation config file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From where did you get this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, along with pretty much everything else, I took from the original derivation (see this). Do you want something changed from it? Some of these settings could probably exposed so that someone can customize them more easily.
CreateFileAssociation=0 | ||
EOF | ||
|
||
($(pwd)/xsetup --agree 3rdPartyEULA,WebTalkTerms,XilinxEULA --batch Install --config install_config.txt || true) | while read line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
($(pwd)/xsetup --agree 3rdPartyEULA,WebTalkTerms,XilinxEULA --batch Install --config install_config.txt || true) | while read line | |
(./xsetup --agree 3rdPartyEULA,WebTalkTerms,XilinxEULA --batch Install --config install_config.txt || true) | while read line |
Why do we allow it to fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, I didn't write it. But, I suppose I can test what happens when it does fail.
sed -i -- 's|`basename "\$0"`|xsdk|g' $out/opt/SDK/2017.2/bin/.xsdk-wrapped | ||
''; | ||
|
||
libPath = lib.makeLibraryPath [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this into a let in to postFixup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get an error when I try to run vivado after doing this: application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory
. It works if I keep it out of the let though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is because your are using bash variables instead of nix ones in preFixup. Please use nix variables there.
@RaitoBezarius I have a vivado 2019.2 expression, you can source it from here: https://github.com/flokli/pynq/blob/master/nix/pkgs/vivado/default.nix |
@SuperSandro2000 I left a few of your comments open because I'm not totally sure I addressed them, but I did update a lot of things. Let me know what you think now. |
# Patch ELFs | ||
for f in $out/opt/Vivado/$version/bin/unwrapped/lnx64.o/* | ||
do | ||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f || true | ||
done | ||
for f in $out/opt/SDK/$version/bin/unwrapped/lnx64.o/* | ||
do | ||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f || true | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Patch ELFs | |
for f in $out/opt/Vivado/$version/bin/unwrapped/lnx64.o/* | |
do | |
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f || true | |
done | |
for f in $out/opt/SDK/$version/bin/unwrapped/lnx64.o/* | |
do | |
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f || true | |
done | |
# Patch ELFs | |
for f in $out/opt/Vivado/$version/bin/unwrapped/lnx64.o/*; do | |
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f | |
done | |
for f in $out/opt/SDK/$version/bin/unwrapped/lnx64.o/*; do | |
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f | |
done |
the build should fail if patchelf fails
wrapProgram $out/opt/Vivado/$version/bin/vivado --prefix LD_LIBRARY_PATH : "$libPath" | ||
wrapProgram $out/opt/SDK/$version/bin/xsdk --prefix LD_LIBRARY_PATH : "$libPath" | ||
wrapProgram $out/opt/SDK/$version/eclipse/lnx64.o/eclipse --prefix LD_LIBRARY_PATH : "$libPath" | ||
wrapProgram $out/opt/SDK/$version/tps/lnx64/jre/bin/java --prefix LD_LIBRARY_PATH : "$libPath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapProgram $out/opt/Vivado/$version/bin/vivado --prefix LD_LIBRARY_PATH : "$libPath" | |
wrapProgram $out/opt/SDK/$version/bin/xsdk --prefix LD_LIBRARY_PATH : "$libPath" | |
wrapProgram $out/opt/SDK/$version/eclipse/lnx64.o/eclipse --prefix LD_LIBRARY_PATH : "$libPath" | |
wrapProgram $out/opt/SDK/$version/tps/lnx64/jre/bin/java --prefix LD_LIBRARY_PATH : "$libPath" | |
for file in $out/opt/Vivado/$version/bin/vivado $out/opt/SDK/$version/bin/xsdk $out/opt/SDK/$version/eclipse/lnx64.o/eclipse $out/opt/SDK/$version/tps/lnx64/jre/bin/java ; do | |
wrapProgram $file --prefix LD_LIBRARY_PATH : "$libPath" | |
done |
# Hack around lack of libtinfo in NixOS | ||
ln -s $ncurses/lib/libncursesw.so.6 $out/opt/Vivado/$version/lib/lnx64.o/libtinfo.so.5 | ||
ln -s $ncurses/lib/libncursesw.so.6 $out/opt/SDK/$version/lib/lnx64.o/libtinfo.so.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can change that name with patchelf which is a bit cleaner
# Patch installed files | ||
patchShebangs $out/opt/Vivado/$version/bin | ||
patchShebangs $out/opt/SDK/$version/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Patch installed files | |
patchShebangs $out/opt/Vivado/$version/bin | |
patchShebangs $out/opt/SDK/$version/bin | |
patchShebangs $out/opt/{Vivado,SDK}/$version/bin |
What's with #93436 (comment) ? |
@flokli I have tried your derivation and xsim simulation failed. The reason is xsim.ini is from Removing and replacing it with a real file also does not solve the issue. It just reappears. I will be using vivado in a VM. |
Adds Vivado 2017.2. Note that most of the work is not my own. I received permission to create this PR by @lukaslaobeyer here. Since Vivado is not open source, you must prefetch the file (see derivation message) in order to build it. Finally, 2017 is not the newest version, but I was unable to make much headway on 2019.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)